package edu.zut.main.thread;

public class ThreadPriority {
    public static void main(String[] args) {
        Thread thread = new Thread(()-> System.out.println("Thread-A running"));
        Thread thread2 = new Thread(()-> System.out.println("Thread-B running"));
        //线程的优先级  1-10   优先级越高，优先获取CPU资源
        thread.setPriority(9);
        thread2.setPriority(4);
        thread.start();
        thread2.start();
    }
}
